package com.fer.t1.client.widgets.fb;

import com.google.gwt.core.client.JavaScriptException;
import com.google.gwt.user.client.ui.HTML;

public class FBWidget extends HTML{

	protected String id;
	
	public FBWidget(String string)
	{
		super(string);
		id=null;
	}
	
	@Override
	protected void onLoad() {
		try {
			if(id==null)
			{
				parseFBXML();
			}
			else
			{
				parseFBXML(id);
			}
		} catch (JavaScriptException e) {
			System.err.println(e);
		}
	}

	protected native void parseFBXML()
	/*-{
		$wnd.FB.XFBML.parse();
	}-*/;
	
	protected native void parseFBXML(String id)
	/*-{
		$wnd.FB.XFBML.parse(document.getElementById(id));
	}-*/;
}
